home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 23
/
Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso
/
Aminet
/
dev
/
e
/
EasyPLUGINs.lha
/
EasyPLUGINs
/
examples
/
dclistview_demo.e
next >
Wrap
Text File
|
1997-09-24
|
2KB
|
51 lines
OPT PREPROCESS, OSVERSION=37
MODULE 'tools/exceptions', 'tools/EasyGUI', 'exec/nodes', 'exec/lists',
'easyplugins/dclistview', 'tools/constructors'
DEF result=-1
PROC main() HANDLE
DEF dclist:PTR TO dclistview_plugin
DEF list, a, nodes
list:=newlist()
nodes:=['zero','one','two','three','four','five','six','seven',
'eight','nine','ten','eleven','twelve','thirteen','fourteen']
ForAll({a}, nodes, `AddTail(list, newnode(NIL, a)))
NEW dclist.dclistview('L_abel', 15,7, list,result,"a",FALSE)
easyguiA('Double Click test',
[EQROWS,
[DCLIST, {listaction},dclist,TRUE], ->note use of ID constant (=PLUGIN)
[EQCOLS,
[SBUTTON, {okaction}, '_OK', dclist, "o"],
[SBUTTON, {disabler}, '_Disable', dclist, "d"],
[SBUTTON, {cancelaction}, '_Cancel', NIL, "c"]
]
])
EXCEPT DO
END dclist
IF exception<>"QUIT" THEN report_exception()
ENDPROC
PROC listaction(info, dclist:PTR TO dclistview_plugin)
IF dclist.clicked THEN okaction(dclist, NIL)
PrintF('Current Selection: \d\n',dclist.current)
ENDPROC
PROC okaction(dclist:PTR TO dclistview_plugin, info)
IF (result:=dclist.current)= -1
PrintF('No selection made\n')
cancelaction(info)
ENDIF
PrintF('Final Selection: \d\n',result)
quitgui(result)
ENDPROC
PROC disabler(dclist:PTR TO dclistview_plugin, info) IS dclist.setdisabled(dclist.disabled=FALSE)
PROC cancelaction(info)
PrintF('Operation cancelled.\n')
quitgui()
ENDPROC